<template>
  <div class="home-header">
    <img src="@/assets/logo.png" alt="">
    <van-dropdown-menu>
      <van-dropdown-item :value="value" :options="options" @change="changeMenu"/>
    </van-dropdown-menu>
  </div>
</template>

<style lang="scss">
.home-header {
  display: flex;
  justify-content: space-between;
  background: #333333;
  img {
    height: 48px;
    width: auto;
  }
  .van-dropdown-menu {
    min-width: 100px;
  }
}
</style>

<script>
export default {
  props: {
    value: Number
  },
  data() {
    return {
      options: [
        { text: '全部商品', value: -1 },
        { text: '新款商品', value: 0 },
        { text: '活动商品', value: 1 },
        { text: '活动商品', value: 2 }
      ]
    }
  },
  methods: {
    changeMenu(newMenu) {
      this.$emit("input", newMenu)
    }
  },
  name: "homeHeader",
}
</script>